<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title><?php echo $this->pageTitle; ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="<?php echo Yii::app()->language; ?>" />
	<meta name="description" content="Eduow е абревиатура от Education over the world. Това е едно Web 2.5 приложение, което има за цел да направи образованието максимално достъпно, като премахне всички езикови, културни, финансови бариери пред гладните за знание потребители. " /> 
        <meta name="keywords" content="eduow, education, образование, обучение, free education, свободно образование, online education, дистанционно образование, study, учене, free online education, безплатно он-лайн образование" /> 
	<meta name="robots" content="index,follow,noarchive" />
	<link rel="shortcut icon" href="/images/favicon.ico" />
        <?php
	if(Yii::app()->user->isGuest){
        	echo Html::cssFile(Html::cssUrl('main.css'))."\n";
	}else{	
		$this->widget('LStyle'); 
	}
        echo Html::cssFile(Html::cssUrl('reset.css'))."\n";
        echo Html::cssFile(Html::cssUrl('typography.css'))."\n";
        echo Html::cssFile(Html::cssUrl('jquery-ui-1.7.2.custom.css'))."\n";
        echo Html::cssFile(Html::cssUrl('jScrollPane.css'));
        echo Html::cssFile(Html::cssUrl('fg.menu.css'));
        echo Html::cssFile(Html::cssUrl('form.css'));
        echo Html::cssFile(Html::cssUrl('mbContainer.css'));
        echo Html::cssFile(Html::cssUrl('addons.css'));
        ?>
        <!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="styles_IE6.css" />
<![endif]-->
<?php 
echo Yii::app()->clientScript->registerCoreScript('jquery')."\n";
echo Html::scriptFile(Html::jsUrl('engine.js'))."\n";
echo Html::scriptFile(Html::jsUrl('jquery.mousewheel.js'))."\n";
echo Html::scriptFile(Html::jsUrl('jScrollPane.js'))."\n";
echo Html::scriptFile(Html::jsUrl('jquery-ui-1.7.2.custom.min.js'))."\n";
echo Html::scriptFile(Html::jsUrl('jquery.bbq.js'))."\n";
echo Html::scriptFile(Html::jsUrl('navigation.js'))."\n";
echo Html::scriptFile(Html::jsUrl('jquery.mb.flipText.min.js'))."\n";
echo Html::scriptFile(Html::jsUrl('fg.menu.js'))."\n";
echo Html::scriptFile(Html::jsUrl('usermenu.js'))."\n";
echo Html::scriptFile(Html::jsUrl('mb/mbContainer.js'))."\n";
echo Html::scriptFile(Html::jsUrl('mb/jquery.metadata.js'))."\n";
echo Html::scriptFile(Html::jsUrl('mb/jquery.cookie.js'))."\n";
echo Html::scriptFile(Html::jsUrl('interface/jquery.dd.js'))."\n";

$src=Yii::app()->request->baseUrl; 
$ui = <<<EOD

$("a:not(.static)").click(function(){

     if($(this).attr("href") != "#"){
     var path = $(this).attr("href").replace("#","");

     get_content(path);
     }
});



$("#refresh").click(function(){
$(window).trigger( 'hashchange' );
return false;
});

$('.portlet-title').toggle(function(){
$(this).parent().animate({
    left: "0px",
    opacity: "0.4"
  }, 1000 ).animate({
    left: "-10px",
    opacity: "1"
  }, 500 );
},function(){
$(this).parent().animate({
    left: "0px",
    opacity: "0.4"
  }, 500 ).animate({
    left: "-180px",
    opacity: "0.2"
  }, 1000 );
});

$('img').hover(
 function()
 {
  this.src = this.src.replace('_off','_on');
 },
 function()
 {
  this.src = this.src.replace('_on','_off');
 }
);



EOD;
Yii::app()->clientScript->registerScript('userInterface', $ui, CClientScript::POS_READY);
?>
        <script type="text/javascript">

            $(function(){

                $(window).bind( 'hashchange', function(z) {
                    var url = $.param.fragment();

                    get_content(url);
                });

                if(document.location.hash){
                    $(window).trigger( 'hashchange' );
                }

            });

            $(function(){
                $("a:not(.static)").each(function(){
                    $(this).attr('href', "#"+$(this).attr("href"));
                });
            });

            $(function(){
                $('.portlet-title').mbFlipText(false);
            });

		function openBook(id){
		var url = "/post/program/id/"+id;
		var program = id;
		   $.get(url, function(data) {
		    $("#container").append(data);

		     $("#book"+program).buildContainers({
				containment:"#container",
			    elementsPath:"/css/elements/"
				 });
		    $("#book"+program).mb_open();
		   });
		}	

		function openNote(id){
		var url = "/note/program/id/"+id;
		var program = id;
		   $.get(url, function(data) {
		    $("#container").append(data);

		     $("#note"+program).buildContainers({
				containment:"#container",
			    elementsPath:"/css/elements/"
				 });
		    $("#note"+program).mb_open();
		   });
		}    

		function openApp(id){
		var url = "/programs/start/id/"+id;
		   $.get(url, function(data) {

		    $("#container").append(data);

		     $("#program"+id).buildContainers({
				containment:"#container",
			    elementsPath:"/css/elements/"
				 });
		    $("#program"+id).mb_open();
		   });
		}


            $(function(){
                $(".hidden").prev().each(function(){
                    $(this).menu({
                        content: $(this).next().html(),
                        backLink: false,
                        topLinkText:'<?php echo Yii::t('yii','All'); ?>',
                        crumbDefaultText:'<?php echo Yii::t('yii','Choose an option:'); ?>'
                    });
                    $(this).attr('href', "#");
                });

            });

        </script>
    </head>

    <body>
        <div id="container">
            <div id="header">
                
                <div id="mainmenu">
                    <?php $this->widget('MainMenu'); ?>
                </div><!-- mainmenu -->
            </div><!-- header -->
	    <?php $this->widget('Sidebar'); ?>
            <?php if(!Yii::app()->user->isGuest) $this->widget('SClipboard'); ?>
            <div id="wrapper" class="ui-widget ui-widget-content ui-corner-all">
                <div id="fader">
                    <div id="content">			
                        <?php echo $content; ?>
                    </div><!-- content -->
                </div>
            </div>
            <div id="footer" class="ui-widget">
                <div id="linkbar">
                    <ul class="usermenu">
                        <li><a href="#" class="static"><?php echo Yii::t('yii','Applications'); ?></a>
                            <ul class="sub_menu">
				<?php if(!Yii::app()->user->isGuest): ?>
					<?php $this->widget('UPrograms'); ?>
				<?php endif; ?>
                                <li><a href="/programs/index"><?php echo Yii::t('yii','Repository'); ?></a></li>
                            </ul>
                        </li>
                        <li><a href="#" class="static"><?php echo Yii::t('yii','System'); ?></a>
                            <ul class="sub_menu">
                                <li>
                                    <a href="#" class="static"><?php echo Yii::t('yii','Comunication'); ?></a>
                                    <ul>
                                        <li><a href="/site/contact"><?php echo Yii::t('yii','Contact'); ?></a></li>
                                    </ul>
                                </li>
                                <?php if(!Yii::app()->user->isGuest): ?>
                                <li><a href="#" class="static"><?php echo Yii::t('yii','About us'); ?></a>
                                    <ul>
                                        <li><a href="/site/eduow"><?php echo Yii::t('yii','About the project'); ?></a></li>
                                        <li><a href="/site/team"><?php echo Yii::t('yii','Who are we'); ?></a></li>
                                    </ul>
                                </li>
                                <li><a href="/news"><?php echo Yii::t('yii','News'); ?></a></li>
                                <?php endif; ?>

                                <li><a href="/site/api"><?php echo Yii::t('yii','Developers'); ?></a></li>
                                <li><a href="/help"><?php echo Yii::t('yii','Help'); ?></a></li>
                            </ul>
                        </li>
                        <?php if(!Yii::app()->user->isGuest): ?>
                        <li><a href="/user/settings"><?php echo Yii::t('yii','Profile'); ?></a></li>
                        <li><a href="/style"><?php echo Yii::t('yii','Style'); ?></a></li>
                        <?php else: ?>
                        <li><a href="/user/register" class="static"><?php echo Yii::t('yii','Register'); ?></a></li>
                        <?php endif; ?>
			<li><a href="/bug/create"><?php echo Yii::t('yii','Report bug'); ?></a></li>
                    </ul>
                </div>
                <div id="dock">
                </div>
		
                <div id="notifybar">
                    <ul class="usermenu">
                        <li><a href="/msg" title="<?php echo Yii::t('yii','Notifications'); ?>" ><img src="/images/alerts.png" alt="<?php echo Yii::t('yii','Notifications'); ?>"/></a>
                        </li>
                        <li><a href="#" title="<?php echo Yii::t('yii','Refresh'); ?>" class="static" id="refresh"><img src="/images/refresh.png" alt="<?php echo Yii::t('yii','Refresh'); ?>"/></a></li>
                        <?php if(Yii::app()->user->isGuest): ?>
                        <li><a href="/user/userlogin" title="<?php echo Yii::t('yii','Log in'); ?>" class="static"><img src="/images/login.png" alt="<?php echo Yii::t('yii','Log in'); ?>"/></a></li>
                        <?php else: ?>
                        <li><a href="/user/logout" title="<?php echo Yii::t('yii','Exit'); ?>" class="static"><img src="/images/loguot.png" alt="<?php echo Yii::t('yii','Exit'); ?>"/></a></li>
                        <?php endif; ?>
                    </ul>
                </div>
            </div><!-- footer -->
        </div><!-- page -->
    </body>
</html>
